% V20210224 - 4.3.3 GW_PREVENT_SELECT INCLUDE "GW.bas" protection = 0 % Start with no protection. % Create the page. p = GW_NEW_PAGE() % Prepare title bar string. Title$ = GW_ADD_BAR_TITLE$("Protection Example") % Title bar on top of page. GW_ADD_TITLEBAR(p, Title$) GW_ADD_TEXT(p, "This page may be protected against copy-paste.") GW_ADD_TITLE(p, "Try to select + copy this text") % Protection status. tx = GW_ADD_TEXT(p, "") GW_ADD_BUTTON(p, "Toggle protection", "protect") decide: IF protection = 1 THEN GW_PREVENT_SELECT(p) % This needs to be set. ELSE GW_ALLOW_SELECT(p) % Before a GW_RENDER(). ENDIF GW_RENDER(p) GW_MODIFY(tx, "text", "protection: "+INT$(protection)) DO % Wait for user action. r$ = GW_WAIT_ACTION$() % Place here any necessary code to process user actions. % Test for the "Toggle protection" button. IF r$ = "protect" THEN protection = 1 - protection GOTO decide ENDIF % End when BACK key is pressed. UNTIL r$ = "BACK" END "End of Protection example."